package org.gnomus.util;

import java.util.*;

public class json {
/*
    public static Map<String, Object> toMap(JSONObject jo) {
        try {
            Map<String, Object> m = new HashMap<String, Object>();
            Iterator<String> i = jo.keys();
            while (i.hasNext()) {
                String key = i.next();
                String value = jo.getString(key);
                m.put(key, value);
            }
            return m;
        } catch (JSONException x) {
            throw new Error(x);
        }
    }

    private static List toList(JSONArray jo) {
        try {
            List list = new ArrayList();
            for (int i = 0; i < jo.length(); i++) {
                Object o = jo.get(i);
                if (o instanceof JSONObject) {
                    list.add(toMap((JSONObject) o));
                } else if (o instanceof JSONArray) {
                    list.add(toList((JSONArray) o));
                } else {
                    list.add(o);
                }
            }
            return list;
        } catch(JSONException x) {
            throw new Error(x);
        }
    }
*/
}
